<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!--
Copyright 2008 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
  <title>Google Earth Plugin - Display Options</title>
  <!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** -->
  <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw">
  </script>
  
  <script type="text/javascript">
google.load("earth", "1");

var ge = null;

function init() {
  google.earth.createInstance("map3d", initCB, failureCB);
}

function initCB(object) {
  ge = object;
  ge.getWindow().setVisibility(true);
  updateOptions();
}

function failureCB(object) {
  /***
   * This function will be called if plugin fails to load, in case
   * you need to handle that error condition.
   ***/
}

function updateOptions() {
  var options = ge.getOptions();
  var form = document.options;
  
  options.setStatusBarVisibility(form.statusbar.checked);
  options.setGridVisibility(form.grid.checked);
  options.setOverviewMapVisibility(form.overview.checked);
  options.setScaleLegendVisibility(form.scaleLegend.checked);
  options.setAtmosphereVisibility(form.atmosphere.checked);
  options.setMouseNavigationEnabled(form.mouseNav.checked);

  if (form.nav.checked) {
    ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);
  } else {
    ge.getNavigationControl().setVisibility(ge.VISIBILITY_HIDE);
  }
}
  </script>
</head>

<body onload='init()'>
  <div style='font-weight:bold; font-size: 16pt; font-family: arial; width: 640px'>
    <center>Google Earth Plugin - Display Options</center>
  </div>
  
  <div id='map3d' style='border: 1px solid silver; height: 480px; width: 640px'></div>
  
  <div id='options_container'> 
    <form name="options" action='javascript:updateOptions();'>
      <input type="checkbox" onclick='updateOptions()' name="statusbar" />Status Bar
      <br />
      <input type="checkbox" onclick='updateOptions()' name="nav" />Navigation Control
      <br />
      <input type="checkbox" onclick='updateOptions()' name="grid" />Grid
      <br />
      <input type="checkbox" onclick='updateOptions()' name="overview" />Overview Map
      <br />
      <input type="checkbox" onclick='updateOptions()' name="scaleLegend" />Scale Legend
      <br />
      <input type="checkbox" onclick='updateOptions()' name="atmosphere" checked />Atmosphere
      <br />
      <input type="checkbox" onclick='updateOptions()' name="mouseNav" checked />Mouse Navigation
      <br />
    </form>
  </div>  
</body>
</html>
